//
//  TileWallViewController.m
//  etionUI
//
//  Created by wangjian on 7/17/13.
//
//

#import "TileWallViewController.h"

@interface CTileWallViewController ()

@end

@implementation CTileWallViewController

@synthesize tileWallView = _tileWallView;
@synthesize tilesThemeColor = _tilesThemeColor;
@synthesize tilesThemeIconName = _tilesThemeIconName;

- (NSArray *)tilesThemeColor
{
    if (_tilesThemeColor == nil)
    {
        _tilesThemeColor = [[NSArray alloc] initWithObjects:@"0x55c6ae", @"0xf28779", @"0x5fa5d4", @"0xeec451", @"0x88cc6e", @"0x5cc2cd", nil];
    }
    return _tilesThemeColor;
}

- (NSMutableArray *)tilesThemeIconName
{
    if (_tilesThemeIconName == nil)
    {
        _tilesThemeIconName = [[NSMutableArray alloc] initWithObjects:@"mothemeiconman", @"mothemeiconadd", @"mothemeiconpic", @"mothemeiconbook", @"mothemeiconcal", @"mothemeiconlist", nil];
    }
    return _tilesThemeIconName;
}

- (void)dealloc
{
    [_tileWallView release];
    [_tilesThemeColor release];
    [super dealloc];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor clearColor];
    
    CTileWallView *tileWallView = [[CTileWallView alloc] initWithFrame:self.view.bounds];
    tileWallView.delegate = self;
    tileWallView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:tileWallView];
    self.tileWallView = tileWallView;
    [tileWallView release];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark tiles wall view delegate

- (NSUInteger)numberOfTilesInTileWallView:(CTileWallView *)tileWallView
{
    return 6;
}

- (CTileView *)tileWallView:(CTileWallView *)tileWallView tileAtIndex:(NSUInteger)index
{
    return [[[CTileView alloc] initWithFrame:CGRectMake(0, 0, tileWallView.tileSize.width, tileWallView.tileSize.height)] autorelease];
}

@end
